using System.Windows.Forms;

namespace pub.GUI
{
    public class FormUtils
    {

        public static Form GetLastForm()
        {
            if (Form.ActiveForm != null)
                return Form.ActiveForm;

            var forms = Application.OpenForms;
            if(forms.Count > 0)
            {
                return forms[forms.Count - 1];
            }

            return null;
        }

    }

}